package di.scanner.store;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;

public class XMLStore {
    private List<String> xmlFilePaths;

    private static XMLStore xmlStore;

    private XMLStore() {
        this.xmlFilePaths = new ArrayList<String>();
    }

    public static XMLStore getInstance(){
        if (xmlStore==null){
            synchronized (FileStore.class){
                if (xmlStore==null){
                    xmlStore = new XMLStore();
                }
            }
        }
        return xmlStore;
    }

    public List<String> getXmlFilePaths() {
        return xmlFilePaths;
    }

    public void add(String filename){
        this.xmlFilePaths.add(filename);
    }

    public String remove(int index){
        return this.xmlFilePaths.remove(index);
    }

    public int getCount(){
        return this.xmlFilePaths.size();
    }
}
